module.exports = app => {
    const mongoose = app.mongoose
    const Schema = mongoose.Schema

    const LikeSchema = new Schema({
        userid:{
            type:Schema.Types.ObjectId,
            ref:'User',
            required:true
        },
        videoid:{
            type:Schema.Types.ObjectId,
            ref:'Video',
            required:true
        },
        like:{
            type:Number,
            enum: [0,1],
            required:true
        },
        create_time:{
            type:Date,
            default:Date.now
        }
    })

    return mongoose.model('Like',LikeSchema)
}